'Sample Metrabus program for the MAO-12 Analog Output Board. This example 'shows how to set up a simple output of a DAC. Please remember that when 'you address a register, that you must also perform a write or read. 'Therefore, each OUT ADRPTR must be followed by a OUT DATAIO or INP 'command. dataio = &H360 'Sets Base address to 768 adrptr = dataio + 1 'Sets Address Pointer to 769 mao12 = 16 'Sets board address of MAO to 16 hibyte = 128 'Sets hibyte to 128 lowbyte = 128 'Sets lobyte to 128 ' point to the channel to update OUT adrptr, mao12 + 2 'Set Addr Pointer to select channel OUT dataio, 0 'Select first channel (Logical 0) ' set the high byte value OUT adrptr, mao12 'Set Addr Pointer to write hibyte OUT dataio, 255 'Write out hibyte value 'set the low byte value OUT adrptr, mao12 + 1 'Set Addr Pointer to write lobyte OUT dataio, 255 'Write out lobyte value ' point to the channel to update OUT adrptr, mao12 + 3 'Set Addr Pointer to update DAC OUT dataio, 1 'Write out a 1 to update DAC 0 '*** This is where some confusion may lie. Not only must you point '*** to the address to trigger a channel, but you also have to do '*** a write of some dummy value. ' Update the channel OUT adrptr, mao12 + 4 'Set Addr Pointer to trigger DACs OUT dataio, 0 'Write out a 0 to trigger DAC's